package umg.util;

import java.util.Arrays;
import java.util.Enumeration;
import java.util.Properties;

public class SortedProperties extends Properties
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@SuppressWarnings(
	{ "unchecked", "rawtypes" })
	public synchronized Enumeration keys()
	{
		final Object[] keys = keySet().toArray();
		Arrays.sort(keys);
		return new Enumeration()
		{
			int i = 0;

			public boolean hasMoreElements()
			{
				return i < keys.length;
			}

			public Object nextElement()
			{
				return keys[i++];
			}
		};
	}
}